package model

import "choujiang/common/db"

type SharePage struct {
	Id        int64  `xorm:"INT(11) not null pk autoincr"`
	PathUrl   string `xorm:"VARCHAR(255)"`
	JumpLeft  string `xorm:"VARCHAR(255)"`
	JumpRight string `xorm:"VARCHAR(255)"`
	CreatedAt int64  `xorm:"not null default 0 INT(11) created"`
	UpdatedAt int64  `xorm:"not null default 0 INT(11) updated"`
}

func (u *SharePage) Insert() (*SharePage, error) {
	_, err := db.MysqlEngine.InsertOne(u)
	return u, err
}

func (u *SharePage) Update() (*SharePage, error) {
	_, err := db.MysqlEngine.ID(u.Id).Update(u)
	return u, err
}
